// pages/contentDetail/contentDetail.js
Page({

    /**
     * 页面的初始数据
     */
    data: {

        arrlist: {},
        lists: [
            "首页",
            "全部商品",
            "夹克",
            "卫衣",
            "休闲裤",
            "t-shirt",
            "牛仔裤",



        ],
        listboolen: true,
        eleindex: 0,
        textNum: 18,



    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {

    },
    changeIndex(options) {
        let id = options.target.dataset.index;
        console.log(123)
        this.setData({
            eleindex: id,
        })

    },
    changeColor() {
        this.setData({
            listboolen: !this.data.listboolen,
            // textNum:this.data.textNum+=1,


        })
        console.log(this.data.listboolen)
        
        if (!this.data.listboolen) {
            let objectAll = {
                id: this.data.arrlist.goodsContent,
                picture: this.data.arrlist.goodsPic,
                price: this.data.arrlist.goodsContentPrice,
                priceOld: this.data.arrlist.goodsContentPriceOld,
            }
            let storageAll=wx.getStorageSync("goodsCartContentAll");
           
            if(storageAll){
                storageAll.push(objectAll);
                wx.setStorageSync("goodsCartContentAll",storageAll);

            }else{
                wx.setStorageSync("goodsCartContentAll",[objectAll]);
            }


    }
},
    /**
    
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
        let arr = wx.getStorageSync("goodsCartLists");
        this.setData({
            arrlist: arr,
        })
        console.log(arr);
    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    }
})